.TH std::enable_nonlocking_formatter_optimization 3 "2024.06.10" "http://cppreference.com" "C++ Standard Libary"
.SH NAME
std::enable_nonlocking_formatter_optimization \- std::enable_nonlocking_formatter_optimization

.SH Synopsis
   Defined in header <format>
   template< class T >                                               (since C++23)
   constexpr bool enable_nonlocking_formatter_optimization = false;

   This template can be used by implementations to enable efficient implementations of
   std::print and std::println.

   If std::enable_nonlocking_formatter_optimization<T> is true, printing an argument of
   type T can be performed in a more efficient way (see std::print for details).
   std::enable_nonlocking_formatter_optimization specializations can be true in the
   following cases:

     * T is one of the types where std::format<T, CharT> is a basic standard
       specialization (see below).
     * A program may specialize this template for any cv-unqualified program-defined
       type T. Such specializations must be usable in constant expressions and have
       type const bool.

   Basic standard specializations

   In the following list, CharT is either char or wchar_t, ArithmeticT is any
   cv-unqualified arithmetic type other than char, wchar_t, char8_t, char16_t, or
   char32_t:

   Nonlocking flag for character formatters
   template<>                                                                     \fB(1)\fP
   inline constexpr bool enable_nonlocking_formatter_optimization<CharT> = true;
   Nonlocking flag for string formatters
   template<>                                                                     \fB(2)\fP
   inline constexpr bool enable_nonlocking_formatter_optimization<CharT*> = true;
   template<>
   inline constexpr bool enable_nonlocking_formatter_optimization<const CharT*> = \fB(3)\fP
   true;
   template< std::size_t N >
   inline constexpr bool enable_nonlocking_formatter_optimization<CharT[N]> =     \fB(4)\fP
   true;
   template< class Traits, class Alloc >

   inline constexpr bool enable_nonlocking_formatter_optimization                 \fB(5)\fP

       <std::basic_string<CharT, Traits, Alloc>> = true;
   template< class Traits >

   inline constexpr bool enable_nonlocking_formatter_optimization                 \fB(6)\fP

       <std::basic_string_view<CharT, Traits>> = true;
   Nonlocking flag for arithmetic formatters
   template<>
   inline constexpr bool enable_nonlocking_formatter_optimization<ArithmeticT> =  \fB(7)\fP
   true;
   Nonlocking flag for pointer formatters
   template<>
   inline constexpr bool enable_nonlocking_formatter_optimization<std::nullptr_t> \fB(8)\fP
   = true;
   template<>                                                                     \fB(9)\fP
   inline constexpr bool enable_nonlocking_formatter_optimization<void*> = true;
   template<>
   inline constexpr bool enable_nonlocking_formatter_optimization<const void*> =  \fB(10)\fP
   true;

.SH See also

   formatter defines formatting rules for a given type
   (C++20)   \fI(class template)\fP
   print     prints to stdout or a file stream using formatted representation of the
   (C++23)   arguments
             \fI(function template)\fP
   println   same as std::print except that each print is terminated by additional new
   (C++23)   line
             \fI(function template)\fP
